#ifndef __LISTENER_H__
#define __LISTENER_H__

#ifdef	__cplusplus
extern "C" {
#endif

#define LISTENER_SUCCESS            0
#define LISTENER_FAILURE            -1
#define EVENT_NULL                  -1

#include "event_queue.h"

    typedef enum event_type {
        EVENT_PREVIOUS_BUTTON,
        EVENT_NEXT_BUTTON,
        EVENT_PREVIOUS_ICON,
        EVENT_NEXT_ICON,
        EVENT_PREVIOUS_EDITBOX,
        EVENT_NEXT_EDITBOX,
        EVENT_PREVIOUS_LISTBOX_PAGE,
        EVENT_NEXT_LISTBOX_PAGE,
        EVENT_PREVIOUS_LISTBOX_ELEMENT,
        EVENT_NEXT_LISTBOX_ELEMENT,
        EVENT_OK,
		EVENT_ENTER,
        EVENT_SWITCH_FOCUS,
        EVENT_ADD_CHAR,
        EVENT_REPLACE_CHAR,
        EVENT_DEL_CHAR,
        EVENT_SEND_MSG,
        EVENT_ESC,
        EVENT_UP,
        EVENT_DOWN,
		EVENT_LEFT,
		EVENT_RIGHT
    } event_type;

    typedef struct event {
        event_type type;
        unsigned int paramsize;
        void *paramp;
    } event;

    typedef event_type listener_type;

    extern int listener_create(listener_type type, void *pFunction);

    extern int listener_eventTrigger(event e);

    extern event_type listener_getEventType(int listenerId);

    extern davint_event_queue_t *listener_eventQueue_request();

#ifdef	__cplusplus
}
#endif

#endif
